Skip to content

Conversation

cpmsmith
Copy link
Contributor

@cpmsmith cpmsmith commented Sep 8, 2025

Several improvements to the Rust scraper here. In screenshots, before is on the left, after is on the right.

Improve broken page names in Rust

As described in #2568:

  • all pages in the Rust Reference had .. on the beginning of their title
  • many had their title as .. The Rust Reference
  • others had their title as the first subheading on the page, but not the main title
  • and some in The Book had similar problems

Now, no empty dots, things in the intro of the book all get 00.00. so they're sorted to the top, and pages in the Book and the Reference all get the correct title.

Screenshots image image

Update to new compiler error codes location

It got moved, and is no longer all on one page.

Screenshot image

Fix and style syntax definitions/diagrams in Rust Reference

The Rust Reference has syntax diagrams and definitions for a bunch of things, which were missing styles and elements before, and had a non-functional toggle button. I put them in a working <details> element and adapted SVG styles from the original.

Screenshot image

Note

This meant changing the global CleantTextFilter to include some SVG elements if they're empty. This affects all the docs, but I think in a mostly positive way. For instance, the Web APIs docs have some broken SVGs in them for this same reason:

Screenshot image

…however, I haven't verified that this will improve this exact case, because the MDN scraper appears to be broken at the moment. (It's broken on main as well)

I also made some modifications to the global link handling, because:

  1. a tags in an SVG don't behave quite like normal ones, so they would break history navigation
  2. Unlike native browser navigation, navigating to a fragment inside a closed <details> element didn't open the <details>, and I added a lot of those, so I implemented that.

Remove visible anchor links from Rust Reference

These are hidden in the original docs, and they're all over the place:

Screenshot image

@cpmsmith cpmsmith requested a review from a team as a code owner September 8, 2025 21:58
@cpmsmith cpmsmith marked this pull request as draft September 15, 2025 14:46
@cpmsmith cpmsmith marked this pull request as ready for review September 15, 2025 14:46
Copy link
Contributor

@simon04 simon04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you!

@simon04 simon04 merged commit ad9b58f into freeCodeCamp:main Sep 25, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants