Commit graph

3 commits

Author SHA1 Message Date
Alexis Bernard
7ae4b858b3 [ruby/rdoc] Display class ancestors in the sidebar #1183
50dda13426
2024-11-04 17:34:27 +00:00
Mike Dalessio
0b38e18488 [ruby/rdoc] feature: Render mixed-in methods and constants with
`--embed-mixins`
(https://github.com/ruby/rdoc/pull/842)

* Embed mixed-in methods and constants with `--embed-mixins`

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.

* Add comment to document why we set object visibility

Co-authored-by: Stan Lo <stan001212@gmail.com>

* Add the mixin_from attribute to CodeObject's initializer

* Add test coverage for private mixed-in attributes.

---------

481c2ce660

Co-authored-by: Stan Lo <stan001212@gmail.com>
2024-10-17 20:40:34 +00:00
Stan Lo
d7af8afe1b [ruby/rdoc] Group code object files into the same directory
(https://github.com/ruby/rdoc/pull/1114)

It's hard to distinguish code object classes by their file names alone.
And given that we have 18 such classes, it'd make the codebase a lot
easier to understand if we grouped them into a single directory.

Given that these classes are all autoloaded in `lib/rdoc.rb` instead
of required individually, this change should have minimum impact on
projects using RDoc as they generally just require `rdoc`, not individual
files. An example is Rails' `sdoc`:
https://github.com/rails/sdoc/blob/main/lib/sdoc/rdoc_monkey_patches.rb

4211292ffe
2024-07-02 10:15:00 +00:00
Renamed from lib/rdoc/class_module.rb (Browse further)