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
feature: Render mixed-in methods and constants with --embed-mixins
#842
base: master
Are you sure you want to change the base?
Conversation
--embed-mixins
--embed-mixins
4841259
to
563c87c
Compare
I've pushed an update to this PR to ensure that code object visibility is respected (which was a bug in the original patch). |
@aycabta I'm curious if you have feedback on this feature? It's off by default but I think would be a real improvement to standard-library classes like Array that inherit significant functionality from Enumerable. |
@aycabta This feature is live at https://nokogiri.org/rdoc/Nokogiri/XML/Node.html#method-i-at_css if you'd like to see what it looks like. Is this something you would consider merging? |
563c87c
to
5c46830
Compare
Rebased off v6.5.0. I still think this is a valuable feature to consider. It's been in use at https://nokogiri.org/rdoc/ for the past year, see https://nokogiri.org/rdoc/Nokogiri/XML/Node.html#method-i-css for example. |
5c46830
to
629de31
Compare
629de31
to
7262a33
Compare
7262a33
to
a3402af
Compare
When `--embed-mixins` option is set: - methods from an `extend`ed module are documented as singleton methods - attrs from an `extend`ed module are documented as class attributes - methods from an `include`ed module are documented as instance methods - attrs from an `include`ed module are documented as instance attributes - constants from an `include`ed module are documented Sections are created when needed, and Darkfish's template annotates each of these mixed-in CodeObjects. We also respect the mixin methods' visibility. This feature is inspired by Yard's option of the same name.
a3402af
to
9f2a9f2
Compare
When
--embed-mixins
option is set:extend
ed module are documented as singleton methodsextend
ed module are documented as class attributesinclude
ed module are documented as instance methodsinclude
ed module are documented as instance attributesinclude
ed module are documentedSections are created when needed, and Darkfish's template annotates
each of these mixed-in CodeObjects.
This feature is inspired by Yard's option of the same name.
Example class:
Currently this renders like:
With
--embed-mixins
it renders like: