Skip to content

Simplify the codebase and fix display paths - #5

Merged
abusch merged 15 commits into
mainfrom
simplify-codebase
Oct 31, 2026
Merged

abusch merged 15 commits into
mainfrom
simplify-codebase

Conversation

@abusch

@abusch abusch commented Oct 31, 2026

Copy link
Copy Markdown
Owner

A pass over the codebase to simplify architecture and code reuse, plus the fixes that turned up along the way. Each commit is one self-contained step.

Fixes

  • Display paths (fix: show items under the paths rustdoc publishes them at): Universe::new now derives the reader-facing std:: spelling the way rustdoc's HTML inlining does. It walks each crate's public namespace, follows named and glob re-exports across crates, and skips #[doc(no_inline)]. This replaces the hard-coded mirror list, which had started showing Rc as std::rc after nightly moved it.
  • Module listings now include unions, statics, and attribute and derive macros. For example, MaybeUninit was missing from std::mem.
  • Code fences are classified the way rustdoc's LangString::parse does. Unknown words mean another language, and hidden # lines are only stripped from Rust blocks.
  • Deprecation notices are bold, so they outweigh unstable ones; the two used to be identical.

Refactors

  • kind.rs: one place that names and classifies item kinds.
  • page.rs: the builder owns its sections, member rows share a single push_member, and default_expanded is gone.
  • render.rs: link ids travel beside spans instead of being smuggled through underline_color. The syntax theme is derived from DEFAULT_THEME, padding goes through one pad_to, and rules use a theme style.
  • app.rs: current_mut(), a single resize(w, h), and help as an overlay flag.
  • main.rs: the status message is cleared inside handle_key, and dead key arms are removed.
  • format.rs: shared path, reference, returns and parameter helpers.

Tests

Tests now assert on page structure (targets, sections) rather than scraped text. Redundant tests are removed, and text_of copies are replaced with Line::to_string().

Other

  • chore: update dependencies
  • chore: switch the default theme to Catppuccin Mocha

Verification

cargo test, cargo clippy --all-targets -- -D warnings and cargo fmt --check pass on every step. The refactors were also checked by diffing rendered output before and after across every item in std/core/alloc:

  • format.rs: byte-identical.
  • render.rs: only wide-character padding changed.
  • Link rendering: only adjacent same-target links merged into one tab stop.

@abusch
abusch merged commit 4cd4ca1 into main Oct 31, 2026
5 checks passed
@abusch
abusch deleted the simplify-codebase branch October 31, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant