ruby/lib/rdoc/generator
Stan Lo c5f0fe1285 [ruby/rdoc] Improve method source toggling
(https://github.com/ruby/rdoc/pull/1176)

* Move method source block to the top

Currently, if a method description is long (e.g. `Array.new`), users need
to click the method toggle button next to the method title, and then scroll
down to the source code expanded below the description.

This commit changes the behavior so that the source code is expanded
immediately below the method title.

* Update method toggle's interface

1. Display the method toggle button by default instead of displaying on hover
2. Only toggle the source code when clicking the method toggle button, not
   when clicking the entire method title section. This will allow us to display
   an anchor link next to the method title
3. Simplify the toggle source button's appearance

* Use details tag for method toggling

* Rename method-click-advice to method-source-toggle

* Improve method controls' display on mobile

By moving the method controls out of the method header, we can display
them to the right of the method name on desktop, and below the method name
on mobile.

* Add "Example" label to example code blocks

The label should help users distinguish example code blocks from other
code blocks, such as method source code.

It's only applied to Ruby code examples.

* Revert "Add "Example" label to example code blocks"

This reverts commit https://github.com/ruby/rdoc/commit/69fc9ce6a379.

* Give source code blocks a different background color

* Change targeted method's highlighting color to work better with the new method source

https://github.com/ruby/rdoc/commit/e608a84af3
2024-10-10 09:45:41 +00:00
..
pot [ruby/rdoc] Improve rubocop setup 2024-07-17 20:43:08 +00:00
template [ruby/rdoc] Improve method source toggling 2024-10-10 09:45:41 +00:00
darkfish.rb Sync rdoc 2024-08-13 09:10:15 -04:00
json_index.rb [ruby/rdoc] Use flat_map for better performance 2023-06-14 23:47:25 +00:00
markup.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
pot.rb [ruby/rdoc] [DOC] nodoc for probably internal methods 2023-12-16 00:26:39 +09:00
ri.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00