Rustdoc table row highlighting for even lines and code highlighting match
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Code
/// Some documentation
///
/// | Heading |
/// | - |
/// | Before `Foo` after |
/// | Before `Bar` after |
fn main() {
println!("Hello, world!");
}
Reproduction Steps
cargo doc
Expected Outcome
Table rows with code blocks have the code block highlighted in a way to render them separately from normal text
Actual Output
Even numbered rows in tables have the same background color as the code blocks. Relevant CSS (first selector includes other targets omitted for simplicity, both include other rules)
.docblock code, {
background-color: var(--code-block-background-color);
}
.docblock table tbody tr:nth-child(2n) {
background: var(--table-alt-row-background-color);
}
--table-alt-row-background-color: #f5f5f5;
--code-block-background-color: #f5f5f5;
Rendered result:
Version
rustdoc 1.98.1 (48a229cea 2026-09-01)
Additional Details
@rustbot label +A-a11y A-rustdoc-ui
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run cargo doc with the provided Rust snippet and inspect the rustdoc CSS rules for .docblock code and alternating table rows. Adjust the relevant styling so code blocks and even-numbered table rows have distinct backgrounds, then regenerate the documentation to confirm the rendered result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100