about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm/mod.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-02-12 10:46:39 +0100
committerGitHub <noreply@github.com>2025-02-12 10:46:39 +0100
commitba32d8bdee714a3d1f122304e9a3d23275c36c75 (patch)
tree8ed04549041edc3ae8a294818cc053903891a9bb /compiler/rustc_codegen_llvm/src/llvm/mod.rs
parent1073aea8d3c01fbfe3299642128cbf593b8898d5 (diff)
parentb594b9f4f54d05f7ac21d2c49c3093f89fd3ed1f (diff)
downloadrust-ba32d8bdee714a3d1f122304e9a3d23275c36c75.tar.gz
rust-ba32d8bdee714a3d1f122304e9a3d23275c36c75.zip
Rollup merge of #136829 - GuillaumeGomez:move-line-numbers-into-code, r=notriddle
[rustdoc] Move line numbers into the `<code>` directly

Fixes #84242.

This is the first for adding support for https://github.com/rust-lang/rust/issues/127334 and also for another feature I'm working on.

A side-effect of this change is that it also fixes source code pages display in lynx since they're not directly in the source code.

To allow having code wrapping, the grid approach doesn't work as the line numbers are in their own container, so we need to move them into the code. Now with this, it becomes much simpler to do what we want (with CSS mostly). One downside: the highlighting became more complex and slow as we need to generate some extra HTML tags directly into the highlighting process. However that also allows to not have a huge HTML size increase.

You can test the result [here](https://rustdoc.crud.net/imperio/move-line-numbers-into-code/scrape_examples/fn.test_many.html) and [here](https://rustdoc.crud.net/imperio/move-line-numbers-into-code/src/scrape_examples/lib.rs.html#10).

The appearance should have close to no changes.

r? ``@notriddle``
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/mod.rs')
0 files changed, 0 insertions, 0 deletions