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

Add support for :showdoc: directive for private and protected objects (RFC #0011) #15337

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

nobodywasishere
Copy link
Contributor

First part of splitting up #15294.

Private class:
image

Private methods:
image
image

@ysbaddaden
Copy link
Contributor

ysbaddaden commented Jan 13, 2025

I've just been thinking of an edge case: we need the parent namespace to appear if any descendant type is marked with :showdoc: but will any documentation following :nodoc: be shown?

# :nodoc:
# 
# this comment musn't appear in docs
module Foo
  # :showdoc:
  #
  # this comment must appear in docs
  module Bar
  end
end

@straight-shoota
Copy link
Member

@ysbaddaden I believe the nodoc nesting showdoc case should be handled because #must_include? checks for :nodoc: in parent namespaces.

But this concern brings up that there should be specs for this to ensure the behaviour is implemented as inspected and won't change by future changes.
Granted, the doc generator specs are not very extensive. But that only means we need to write more tests, not less. I believe there should be ample existing examples that can be adapted to add relevant examples for testing this change.

@nobodywasishere
Copy link
Contributor Author

@ysbaddaden I believe the behavior determined during discussion with the RFC is that a :showdoc: inside a :nodoc: would prevent the showdoc from working.

@straight-shoota I can work on adding doc generator specs.

@nobodywasishere
Copy link
Contributor Author

@nobodywasishere
Copy link
Contributor Author

Let me know if you have more ideas for specs

@crysbot
Copy link

crysbot commented Jan 21, 2025

This pull request has been mentioned on Crystal Forum. There might be relevant details there:

https://forum.crystal-lang.org/t/win32cr-1-0-release/7630/2

Using :showdoc: on a namespace does not apply to child methods / objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants