Re: [PATCH 04/13] rust: kernel: add srctree-relative doclinks

From: Valentin Obst
Date: Thu Jan 18 2024 - 03:38:47 EST


> Hm, I wonder if we could figure out a way to make links point to
> specific definitions in the C headers with # anchors. I'm not sure
> what the intended platform to view these links is.

Currently the links simply open the plain .h file from your local tree in your
browser, i.e.,

```rust
/// [`struct wait_queue_head`]: srctree/include/linux/wait.h
```

becomes something like:

file:///mnt/build/rust-for-linux/rust4lx/include/linux/wait.h

and fragments won't work on that.

I agree that it would be nice to link to type definitions, variables,
functions, ect. in the file, maybe with something like:

```
#(type|var|func);<identifier>
```

However, I think this will require some parsing and embedding the C
source file into some html.