devdocs icon indicating copy to clipboard operation
devdocs copied to clipboard

Fix the broken "Show source" toggle for Ruby 3.4 docs

Open StalemateInc opened this issue 10 months ago • 0 comments

Should fix https://github.com/freeCodeCamp/devdocs/issues/2417.

With Ruby 3.4 the documentation is generated using a different theme, which impacted the layout of the page and the classes for HTML elements. Without the change the "Source" toggle from the original doc is copied over into the the final document without doing anything, whereas the expected header "Show source" link is missing and as the result the source code cannot be viewed.

This PR updates Docs::Rdoc::CleanHtmlFilter to add a link for methods with the source and remove the superfluous "Source" toggle from the original documentation.

Manually tested on documentation from Ruby 3.3 and 3.4.

Before Screenshot 2025-03-26 at 22 21 04
After Screenshot 2025-03-26 at 22 22 57

StalemateInc avatar Mar 26 '25 19:03 StalemateInc