ruby/lib/rdoc
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 69fc9ce6a3.

* Give source code blocks a different background color

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

e608a84af3
2024-10-10 09:45:41 +00:00
..
code_object [ruby/rdoc] Improve rubocop setup 2024-07-17 20:43:08 +00:00
generator [ruby/rdoc] Improve method source toggling 2024-10-10 09:45:41 +00:00
i18n
markdown [ruby/rdoc] [DOC] Add missing documents 2023-12-16 00:26:37 +09:00
markup [ruby/rdoc] Fix ToRdoc#accept_table 2024-10-03 12:27:43 +00:00
parser Sync rdoc 2024-08-05 08:27:45 +08:00
rd Generate parsers of RDoc with Racc 1.8.1 2024-08-21 13:30:01 +09:00
ri [ruby/rdoc] Abort with error message if --dump argument invalid 2024-05-30 00:09:22 +00:00
stats [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
.document
code_object.rb
code_objects.rb
comment.rb [DOC] Link fixes 2023-10-03 16:31:34 +09:00
cross_reference.rb [ruby/rdoc] [DOC] Add missing documents 2023-12-16 00:26:37 +09:00
encoding.rb [ruby/rdoc] Remove unused method RDoc::Encoding.remove_frozen_string_literal 2023-12-16 00:25:51 +09:00
erb_partial.rb [ruby/rdoc] Auto-correct trailing new lines 2023-06-03 01:42:29 +00:00
erbio.rb [ruby/rdoc] Remove code for versions older than Ruby 2.6 2023-09-05 01:14:52 +00:00
generator.rb
i18n.rb
known_classes.rb
markdown.rb Require space between hash/content in ATX heading (#1140) 2024-07-18 09:40:01 +09:00
markup.rb [ruby/rdoc] [DOC] Mods about markup formats 2024-07-29 13:16:18 +00:00
options.rb [ruby/rdoc] [DOC] Mods about markup formats 2024-07-29 13:16:18 +00:00
parser.rb [ruby/rdoc] Drop unnecessary file_name parameter from Parser.for 2024-07-31 14:36:41 +00:00
rd.rb
rdoc.gemspec rake install command is failed (#1170) 2024-09-05 16:53:31 +00:00
rdoc.rb [ruby/rdoc] Add home page link to output message 2024-09-27 13:58:36 +00:00
ri.rb
rubygems_hook.rb
servlet.rb
stats.rb
store.rb [ruby/rdoc] Fix NoMethodError for start_with 2024-03-21 04:18:26 +00:00
task.rb [ruby/rdoc] [DOC] Mods about markup formats 2024-07-29 13:16:18 +00:00
text.rb [ruby/rdoc] [DOC] Add missing documents 2023-12-16 00:26:37 +09:00
token_stream.rb [ruby/rdoc] Early return when token_stream is nil 2023-12-05 06:21:52 +00:00
tom_doc.rb [ruby/rdoc] [DOC] Mods about markup formats 2024-07-29 13:16:18 +00:00
version.rb [ruby/rdoc] Bump up 6.7.0 2024-05-23 01:17:32 +00:00